
#include <iostream>
#include<vector>
#include "vector.h"
using namespace std;


void test1()
{
	MyVector::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.insert(v.end(), 4);
	v.insert(v.end(), 5);
	v.insert(v.end(), 6);
	v.insert(v.end(), 7);
	v.insert(v.end(), 8);
	v.insert(v.end(), 9);
	v.erase(v.begin() + 5);
	v.erase(v.end());
	v.erase(v.end());
	v.erase(v.end());
	v.erase(v.end());
	v.erase(v.end());
	v.erase(v.end());

	auto it = v.begin();
	while (it != v.end())
	{
		cout << *it << " ";
		it++;
	}

	cout << endl;

}

void test2()
{
	MyVector::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.insert(v.end(), 4);
	v.insert(v.end(), 5);
	v.insert(v.end(), 6);
	v.insert(v.end(), 7);
	v.insert(v.end(), 8);
	v.insert(v.end(), 9);
	v.erase(v.begin() + 5);
	v.pop_back();
	v.pop_back();
	v.pop_back();
	v.pop_back();
	v.pop_back();


	auto it = v.begin();
	while (it != v.end())
	{
		cout << *it << " ";
		it++;
	}

	cout << endl;
}



void test3()
{
	MyVector::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.insert(v.end(), 4);
	v.insert(v.end(), 5);
	v.insert(v.end(), 6);
	v.insert(v.end(), 7);
	v.insert(v.end(), 8);
	v.insert(v.end(), 9);
	v.resize(20, 1);

	for (auto e : v)
	{
		cout << e << " ";

	}
	cout << endl;
	cout << v[1] << endl;
}

void test4()
{
	MyVector::vector<string> v;
	v.push_back("aaaaa");
	v.push_back("bbbbb");
	v.push_back("ccccc");
	v.push_back("ddddd");
	v.push_back("eeeee");

	MyVector::vector<string> v1(v);
	

	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;


	for (auto e : v)
	{
		cout << e << " ";

	}
	cout << endl;

	//cout << v[1]<<" "<<v[2]<<endl;

}

void test5()
{
	MyVector::vector<string> v;
	v.push_back("aaaaa");
	v.push_back("bbbbb");
	v.push_back("ccccc");
	v.push_back("ddddd");
	v.push_back("eeeee");

	MyVector::vector<string> v1;
	v1 = v;

	for (auto x : v1)
	{
		cout << x << " ";
	}
	cout << endl;


	for (auto e : v)
	{
		cout << e << " ";

	}
	cout << endl;

}


int main()
{
	test5();


	return 0;
}
